<?
/**
 * <b>Hli_Serializer Class</b>
 * Published 21/12/2010 03:45:13
 *
 * @author Lars Sorhus (lars@saucecode.com.au)
 * @copyright sauceCode Pty Ltd.
 * @version 2.0.4.342.
 * @internal It's not recommended at all to modify this code.
 */

//Begin Class
class Hli_Serializer{
	public $data=array();

	public function  __construct(){
		$this->data=array();
	}

	/**
	 * @method serialize
	 * @return Array
	 */
	public function serializeToArray(){
		$data=$this->data;
		foreach($data as $key=>$value){
			if(get_class($value)){
//				print("<p>$key is a class: ".get_class($value)."</p>");
				if(is_subclass_of($value,"Hli_Serializer")){
//					print("<p>".get_class($value)." is also a subclass of Hli_Serializer.</p>");
					$data[$key]=$data[$key]->serializeToArray();
//					print("<pre>");
//					print_r($data[$key]);
//					print("</pre>");
				}
			}
		}
		return($data);
	}
}
?>
